/**
 * @author Sudarsan
 * Provides services for the domain object Employee.
 */
public class EmployeeService {

	private Employee[] employees = new Employee[100];
	static int USER_COUNT = 0;

	/**
	 * @param employee
	 * Creates an Object Employee in the Array
	 */
	public void create(Employee employee) {
		employees[USER_COUNT] = employee;
		++USER_COUNT;
	}

	/**
	 * @return  an Array of Employees
	 */
	public Employee[] getAll() {
		return employees;
	}

	/**
	 * @param employeeId
	 * @return an Employe given with employeeId
	 */
	public Employee findById(int employeeId) {

		for (int i = 0; i < USER_COUNT; i++) {

			Employee employee = employees[i];

			if (employee.getEmployeeId() == employeeId) {

				return employee;

			}
		}
		
		return null;
	}

}
